From: Kevin Ryde Date: Mon, 16 Nov 2009 22:52:29 +0000 (+0000) Subject: * textmodes/flyspell.el (sgml-mode-flyspell-verify): Use X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~9438 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=eefa314fc09ac1622405a4ca60962849ea45215e;p=emacs.git * textmodes/flyspell.el (sgml-mode-flyspell-verify): Use `sgml-lexical-context' instead of own parse for tag. (Further to Bug#4511). --- diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index bffbbbc3cc1..9aaf466f0ed 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -360,13 +360,14 @@ property of the major mode name.") (put 'nxml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify) (defun sgml-mode-flyspell-verify () - "Function used for `flyspell-generic-check-word-predicate' in SGML mode." - (not (save-excursion - (or (looking-at "[^<\n]*>") - (ispell-looking-back "<[^>\n]*" (line-beginning-position)) - (and (looking-at "[^&\n]*;") - (ispell-looking-back "&[^;\n]*" - (line-beginning-position))))))) + "Function used for `flyspell-generic-check-word-predicate' in SGML mode. +Tag and attribute names are not spell checked, everything else is. + +String values of attributes are checked because they can be text +like \"Some." + + (not (memq (car (sgml-lexical-context)) + '(tag pi)))) ;;*---------------------------------------------------------------------*/ ;;* Programming mode */